/*
 * @Author: cz
 * @Date: 2019-05-13 10:51
 * @Last Modified by:
 * @Last Modified time: 2019-05-13 10:51
 * @Description: 课题相关
 */

import request from '@/router/axios'
import {fileTaskUrls} from '@/const/apiUrl'

/**
 * 课题列表查询
 * @param {*} query
 */
export function getTodoList (query) {
  return request({
    url: fileTaskUrls.getTodoList,
    method: 'get',
    params:query
  })
}

/**
 * 退回补充材料收集
 * @param {*} query
 */
export function replenishCollectionFile (query) {
  return request({
    url: fileTaskUrls.replenishCollectionFile,
    method: 'post',
    data: query
  })
}


/**
 * 催办材料收集
 * @param {*} query
 */
export function urgentCollection (id) {
  return request({
    url: fileTaskUrls.urgentCollection+id,
    method: 'put',
  })
}


/**
 * 提交审核，材料收集任务
 * @param {*} query
 */
export function submitCheck (id) {
  return request({
    url: fileTaskUrls.submitCheck+id,
    method: 'put',
  })
}


/**
 * 分页获取材料收集任务
 * @param {*} query
 */
export function getmaterialCollectionAll (query) {
  return request({
    url: fileTaskUrls.getmaterialCollectionAll,
    method: 'get',
    params:query,
  })
}

/**
 * 增加材料收集任务
 * @param {*} query
 */
export function addMaterialCollection (query) {
  return request({
    url: fileTaskUrls.addMaterialCollection,
    method: 'post',
    data: query
  })
}

/**
 * 分页获取课题材料收集任务（只返回属于当前部门的）
 * @param {*} query
 */
export function getmaterialCollectionSingle () {
  return request({
    url: fileTaskUrls.getmaterialCollectionSingle,
    method: 'get',
  })
}

/**
 * 材料收集任务详情
 * @param {*} query
 */
export function getMaterialDetail(fileTaskId) {
  return request({
    url: fileTaskUrls.getMaterialDetail + fileTaskId,
    method: 'get'
  })
}


/**
 * 导出材料收集信息
 * @param {*}
 * @param {*}
 */
export function exportToDoCollectionData (query) {
  return request({
    url: fileTaskUrls.exportToDoCollectionData,
    method: 'get',
    responseType: 'blob',
    params: query
  })
}

/**
 * 导出材料收集信息excel
 * @param {*}
 * @param {*}
 */
export function exportToDoCollectionDataExcel (query) {
  return request({
    url: fileTaskUrls.exportToDoCollectionDataExcel,
    method: 'get',
    responseType: 'blob',
    params: query
  })
}
